//
//  InputCarPricesTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Tedu on 16/8/26.
//
//

#import "InputCarPricesTableViewCell.h"

@implementation InputCarPricesTableViewCell
#pragma mark - 生命周期 life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self inputTF];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

#pragma mark - 懒加载 lazy loading
- (UITextField *)inputTF {
    if(_inputTF == nil) {
        _inputTF = [[UITextField alloc] init];
        [self.contentView addSubview:_inputTF];
        [_inputTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.unitLB.mas_left).equalTo(-8);
            make.top.equalTo(4);
            make.bottom.equalTo(-4);
            make.left.equalTo(self.leftTipLB.mas_right).equalTo(8);
        }];
        _inputTF.placeholder = @"官方指导价74.70";
        _inputTF.font = [UIFont systemFontOfSize:15 * AUTO_WIDTH];
        _inputTF.clearButtonMode = UITextFieldViewModeWhileEditing;
        _inputTF.textAlignment = NSTextAlignmentRight;
    }
    return _inputTF;
}

- (UILabel *)unitLB {
    if(_unitLB == nil) {
        _unitLB = [[UILabel alloc] init];
        [self.contentView addSubview:_unitLB];
        [_unitLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(-15);
            make.centerY.equalTo(0);
            make.width.equalTo(40 * AUTO_WIDTH);
        }];
        _unitLB.font = defaultFont;
        _unitLB.text = @"万元";
        _unitLB.textAlignment = NSTextAlignmentRight;
    }
    return _unitLB;
}

- (UILabel *)leftTipLB {
    if(_leftTipLB == nil) {
        _leftTipLB = [[UILabel alloc] init];
        [self.contentView addSubview:_leftTipLB];
        [_leftTipLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(8);
            make.centerY.equalTo(0);
        }];
        _leftTipLB.text = @"输入车行报价";
        _leftTipLB.font = defaultFont;
    }
    return _leftTipLB;
}

@end
